<?php defined('ByShopWWI') or exit('Access Invalid!');?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <title>{$product.name}产品证书</title>
    <script type="text/javascript">
        document.addEventListener('plusready', function(){
            //console.log("所有plus api都应该在此事件发生后调用，否则会出现plus is undefined。"
        });
    </script>
    <link href="<?php echo SHOP_TEMPLATES_URL;?>/css/cpxx_global.css" rel="stylesheet" type="text/css">
    <style>
        .test1{ font-family: "幼圆" !important;}
        .test2{font-family:"宋体" !important;}
        .test3{font-family:"华文黑体" !important;}
        .test4{ font-family: "幼圆" !important;}
        .backimage{ background: url(__PUBLIC__/img/op_02.jpg) no-repeat center; background-size: 100% 1002px; width: 100%;}
        .img2{width: 88%; max-width: 320px;}
    </style>
</head>
<body>
<!--
<p class="test1">测试:微软雅黑</p>
<p class="test2">测试:华文黑体</p>
-->

<div class="fl" style="width: 100%;">
    <img style="width: 100%;" src="__PUBLIC__/img/op_01.jpg" />
</div>
<div class="backimage">

    <div style="text-align: center;">
        <img style="width: 35%; margin-top: -15px;" src="__PUBLIC__/img/cunlogo.png" />
    </div>

    <div style="text-align: center;">
        <img class="img2" src="{$product.imgurl}" />
    </div>

    <div style="width: 88%; margin: 0 auto; border: 1px solid #a97c50; font-size: 18px;">

        <div class="fl" style="width: 100%; border-bottom: 1px solid #a97c50;">
            <p class="fl test1" style=" width: 20%;min-width: 108px; padding: 8px 10px; background: #c49a6c; color: #FFFFFF;">证书编号 <span class="test2">NO.</span></p>
            <p class="fl test1" style="color: #ad9e80; padding: 8px 10px;">{$product.certificate_no}</p>
        </div>
        <div class="fl" style="width: 100%;">
            <p class="fl test1" style=" width: 20%;min-width: 108px; padding: 8px 10px; background: #c49a6c; color: #FFFFFF;">识别码 <span class="test2">NO.</span></p>
            <p class="fl test1" style="color: #ad9e80; padding: 8px 10px;">{$product.identifier}</p>
        </div>
        <div style="clear: both;"></div>
    </div>
    <div style="background: url(__PUBLIC__/img/op_02.jpg) no-repeat center;background-position-y: 99%; background-size: 100%; width: 100%;">
        <div style="width: 88%; margin: 0 auto;">

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">检验结果<br/><label style=" font-size:12px;color: #8b5e3c;">Result</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.silver_content}</p>
            </div>

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">来样名称<br/><label style=" font-size:12px;color: #8b5e3c;">Name</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.name}</p>
            </div>

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">质量/尺寸<br/><label style=" font-size:12px;color: #8b5e3c;">Welght/Slze</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.quality}</p>
            </div>

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">体验依据<br/><label style=" font-size:12px;color: #8b5e3c;">Test Critera</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.inspection_basis}</p>
            </div>

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">备注<br/><label style=" font-size:12px;color: #8b5e3c;">Remarks</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.remarks}</p>
            </div>

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">检验师<br/><label style=" font-size:12px;color: #8b5e3c;">Tester</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.inspector}</p>
            </div>

            <div class="fl" style="width: 100%; margin-top: 30px;">
                <p class="fl test3" style=" font-size: 18px; color: #8b5e3c; width: 30%; min-width: 60px;">负责人<br/><label style=" font-size:12px;color: #8b5e3c;">Supervisor</label></p>
                <p class="fl test4" style=" font-size:18px;width:70%;border-bottom: #8b5e3c 1px solid; padding-bottom: 16px; color:#333333;">&nbsp; {$product.principal}</p>
            </div>
            <div style="clear: both; margin-bottom: 60px;"></div>
        </div>
        <div style="clear: both;"></div>
    </div>


</div>
<div></div>
</body>
</html>









<link href="<?php echo SHOP_TEMPLATES_URL;?>/css/home_goods.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="<?php echo SHOP_RESOURCE_SITE_URL;?>/js/mz-packed.js" charset="utf-8"></script>
<div class="wrapper pr">
    <input type="hidden" id="lockcompare" value="unlock" />
    <div class="ncs-detail<?php if ($output['store_info']['is_own_shop']) echo ' ownshop'; ?>">
        <!-- 焦点图 -->
        <div id="ncs-goods-picture" class="ncs-goods-picture">
            <div class="gallery_wrap">
                <div class="gallery"><img title="鼠标滚轮向上或向下滚动，能放大或缩小图片哦~" src="<?php echo $output["goods_image"]["0"]["1"] ?>" class="cloudzoom" data-cloudzoom="zoomImage: '<?php echo $output["goods_image"]["0"]["2"] ?>'"> </div>
            </div>
            <div class="controller_wrap">
                <div class="controller">
                    <ul>
                        <?php foreach ($output["goods_image"] as $key => $value) { ?>
                            <li><img title="鼠标滚轮向上或向下滚动，能放大或缩小图片哦~" class='cloudzoom-gallery' src="<?php echo $value['0'] ?>" data-cloudzoom="useZoom: '.cloudzoom', image: '<?php echo $value['1'] ?>', zoomImage: '<?php echo $value['2'] ?>' " width="60" height="60"></li>
                        <?php  }?>
                    </ul>
                </div>
            </div>
        </div>
        <!-- //焦点图 -->

        <!-- S 商品基本信息 -->
        <div class="ncs-goods-summary">

            <div class="box100">
                <div class="row1"><?php echo $output['goods']['goods_name']; ?></div>
                <div class="row2">jingle<?php echo str_replace("\n", "<br>", $output['goods']['goods_jingle']);?></div>
                <div class="row3">
                    商城价：
		<span>
			<?php if (isset($output['goods']['promotion_price']) && !empty($output['goods']['promotion_price'])) {?>
                <strong><i><?php echo $lang['currency'];?></i><?php echo ncPriceFormat($output['goods']['promotion_price']);?></strong><em>(原售价<?php echo $lang['nc_colon'];?><?php echo $lang['currency'].ncPriceFormat($output['goods']['goods_price']);?>)</em>
            <?php } else {?>
                <strong><?php echo $lang['currency'].ncPriceFormat($output['goods']['goods_price']);?></strong>
            <?php }?>
		</span>
                </div>
                <div class="row4">
                    <table>
                        <tbody><tr>
                            <td>
                                <p class="orange">20%</p>
                                <p>年利率</p>
                            </td>
                            <td>
                                <p class="orange">￥10,000</p>
                                <p>年收益</p>
                            </td>
                            <td>
                                <p class="orange">5年</p>
                                <p>年限</p>
                            </td>
                        </tr>
                        </tbody></table>
                </div>
                <div id="i_checkbox" class="row5">
                    <div class="title">规格</div>
                    <div class="checkbox hover">
                        <span data-value="1">金贵银壶1</span>
                    </div>
                    <div class="checkbox">
                        <span data-value="2">金贵银壶2</span>
                    </div>
                    <input type="hidden" name="" value="1">
                </div>
                <div class="row6 ncs-buy">
                    <div class="title">数量</div>

                    <?php if ($output['goods']['goods_state'] != 0 && $output['goods']['goods_storage'] >= 0) {?>
                        <div class="ncs-figure-input">
                            <input type="text" name="" id="quantity" value="1" size="3" maxlength="6" class="input-text" <?php if ($output['goods']['is_fcode'] == 1) {?>readonly<?php }?>>
                            <a href="javascript:void(0)" class="increase" <?php if ($output['goods']['is_fcode'] != 1) {?>nctype="increase"<?php }?>>&nbsp;</a> <a href="javascript:void(0)" class="decrease" <?php if ($output['goods']['is_fcode'] != 1) {?>nctype="decrease"<?php }?>>&nbsp;</a> </div>
                        <div class="ncs-point" style="display: none;"><i></i>
                            <!-- S 库存 -->
                            <span>您选择的商品库存<strong nctype="goods_stock"><?php echo $output['goods']['goods_storage']; ?></strong><?php echo $lang['nc_jian'];?></span>
                            <!-- E 库存 -->
                            <?php if ($output['goods']['is_virtual'] == 1 && $output['goods']['virtual_limit'] > 0) { ?> <!-- 虚拟商品限购数 -->
                                <span class="look">，每人次限购<strong>
                                        <!-- 虚拟特卖 设置了虚拟特卖限购数 该数小于原商品限购数 -->
                                        <?php echo ($output['goods']['promotion_type'] == 'groupbuy' && $output['goods']['upper_limit'] > 0 && $output['goods']['upper_limit'] < $output['goods']['virtual_limit']) ? $output['goods']['upper_limit'] : $output['goods']['virtual_limit'];?> </strong>件商品。</span>
                            <?php } else if ($output['goods']['promotion_type'] == 'groupbuy' && $output['goods']['upper_limit'] > 0){ ?> <!-- 特卖限购 -->
                                <span class="look">，每人次限购<strong>
                                        <?php echo $output['goods']['upper_limit'];?> </strong>件商品。</span>
                            <?php }?>
                            <?php if ($output['goods']['is_fcode'] == 1) {?>
                                <span class="look">，每个F码可优先购买一件商品。</span>
                            <?php }?>
                        </div>
                    <?php } ?>

                </div>
                <div class="row7">

                    <!-- S 购买按钮 -->
                    <div class="ncs-btn">


                        <?php if ($output['goods']['buynow'] == true) {?>
                            <!-- 立即购买-->
                            <a href="javascript:void(0);" nctype="buynow_submit" class="buynow <?php if ($output['goods']['goods_state'] == 0 || $output['goods']['goods_storage'] <= 0 || ($output['goods']['is_virtual'] == 1 && $output['goods']['virtual_indate'] < TIMESTAMP)) {?>no-buynow<?php }?>" title="<?php echo $output['goods']['buynow_text'];?>"><?php echo $output['goods']['buynow_text'];?></a>
                        <?php }?>

                        <?php if ($output['goods']['cart'] == true) {?>
                            <!-- 加入购物车-->
                            <a href="javascript:void(0);" nctype="addcart_submit" class="addcart <?php if ($output['goods']['goods_state'] == 0 || $output['goods']['goods_storage'] <= 0) {?>no-addcart<?php }?>" title="<?php echo $lang['goods_index_add_to_cart'];?>"><i class=""></i><?php echo $lang['goods_index_add_to_cart'];?></a>
                        <?php } ?>


                        <!-- S 加入购物车弹出提示框 -->
                        <div class="ncs-cart-popup">
                            <dl>
                                <dt><?php echo $lang['goods_index_cart_success'];?><a title="<?php echo $lang['goods_index_close'];?>" onClick="$('.ncs-cart-popup').css({'display':'none'});">X</a></dt>
                                <dd><?php echo $lang['goods_index_cart_have'];?> <strong id="bold_num"></strong> <?php echo $lang['goods_index_number_of_goods'];?> <?php echo $lang['goods_index_total_price'];?><?php echo $lang['nc_colon'];?><em id="bold_mly" class="saleP"></em></dd>
                                <dd class="btns"><a href="javascript:void(0);" class="ncbtn-mini ncbtn-mint" onClick="location.href='<?php echo SHOP_SITE_URL.DS?>index.php?act=cart'"><?php echo $lang['goods_index_view_cart'];?></a> <a href="javascript:void(0);" class="ncbtn-mini" value="" onClick="$('.ncs-cart-popup').css({'display':'none'});"><?php echo $lang['goods_index_continue_shopping'];?></a></dd>
                            </dl>
                        </div>
                        <!-- E 加入购物车弹出提示框 -->
                    </div>
                    <!-- E 购买按钮 -->


                </div>
                <div class="row8"></div>
            </div>







        </div>

        <div class="clear"></div>
    </div>
    <!-- S 优惠套装 -->
    <?php if(!empty($output['goods_commend']) && is_array($output['goods_commend']) && count($output['goods_commend'])>1){?>
        <div class="ncs-recommend">
            <div class="title">
                <h4>为您推荐</h4>
            </div>
            <div class="content">
                <ul>
                    <?php foreach($output['goods_commend'] as $goods_commend){?>
                        <?php if($output['goods']['goods_id'] != $goods_commend['goods_id']){?>
                            <li>
                                <dl>

                                    <dt class="goods-name"><a href="<?php echo urlShop('goods', 'index', array('goods_id' => $goods_commend['goods_id']));?>" target="_blank" title="<?php echo $goods_commend['goods_jingle'];?>"><?php echo $goods_commend['goods_name'];?></a></dt>
                                    <dd class="goods-pic"><a href="<?php echo urlShop('goods', 'index', array('goods_id' => $goods_commend['goods_id']));?>" target="_blank" title="<?php echo $goods_commend['goods_jingle'];?>"><img src="<?php echo thumb($goods_commend, 240);?>" alt="<?php echo $goods_commend['goods_name'];?>"/></a></dd>

                                    <dd class="goods-price"><?php echo $lang['currency'];?><?php echo $goods_commend['goods_promotion_price'];?></dd>
                                </dl>
                            </li>
                        <?php }?>
                    <?php }?>
                </ul>
                <div class="clear"></div>
            </div>
        </div>
    <?php }?>
    <div class="ncs-promotion" id="nc-bundling" style="display:none;"></div>
    <!-- E 优惠套装 -->
    <div id="content" class="ncs-goods-layout expanded" >
        <div class="ncs-goods-main" id="main-nav-holder">
            <div class="tabbar pngFix" id="main-nav">
                <div class="ncs-goods-title-nav">
                    <ul id="categorymenu">
                        <li class="current"><a id="tabGoodsIntro" href="javascript:void(0)"><?php echo $lang['goods_index_goods_info'];?></a></li>
                        <?php if ($output['goods']['is_virtual'] == 1) {?>

                        <?php }?>
                        <li><a id="tabGoodsRate" href="javascript:void(0)"><?php echo $lang['goods_index_evaluation'];?><em>(<?php echo $output['goods_evaluate_info']['all'];?>)</em></a></li>

                        <li><a id="tabGuestbook" href="javascript:void(0)">常见问题</a></li>

                    </ul>

                </div>
            </div>

            <div class="report_img"  style="display: none; text-align: center; margin:20px 0 0 0;" >

                <img src="<?php echo thumb_report($output['goods'], 1280);?>" >
            </div>

            <div class="ncs-intro">
                <div class="content bd" id="ncGoodsIntro">


                    <table width="800" class="table">
                        <thead>
                        <tr>
                            <td align="right" width="10%">产品名称：</td>
                            <td width="20%"><p>笔筒</p></td>
                            <td align="right" width="10%">材质：</td>
                            <td width="20%"><p>99.99%千足银</p></td>
                            <td align="right" width="10%">质量：</td>
                            <td width="20%"><p>笔筒</p></td>
                        </tr>
                        </thead>
                        <tr>
                            <td align="right" >规格尺寸：</td>
                            <td><p>99.99%千足银</p></td>
                            <td align="right" >品牌：</td>
                            <td><p>金贵牌</p></td>
                            <td align="right" >产地：</td>
                            <td><p>湖南郴州</p></td>
                        </tr>
                        <tr>
                            <td align="right" >备注：</td>
                            <td rowspan="5"><p>具有收藏价值，可回收。</p></td>
                        </tr>
                    </table>


                    <div class="ncs-goods-info-content">
                        <?php if (isset($output['plate_top'])) {?>
                            <div class="top-template"><?php echo $output['plate_top']['plate_content']?></div>
                        <?php }?>
                        <div class="default"><?php echo $output['goods']['goods_body']; ?></div>
                        <?php if (isset($output['plate_bottom'])) {?>
                            <div class="bottom-template"><?php echo $output['plate_bottom']['plate_content']?></div>
                        <?php }?>
                    </div>
                </div>
                <div class="pingjia" style="display:none;">
                    
                    <div class="pingjia_all">
                        <div class="title">全部评价（999+）</div>
                        <div class="node">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td rowspan="3" width="80" align="right" valign="top">
                                        <img src="{$r}/img/i-f-weibo.jpg" alt=""></td>
                                    <td colspan="2">用户名</td>
                                </tr>
                                <tr>
                                    <td colspan="2">评论内容</td>
                                </tr>
                                <tr>
                                    <td>2016-01-01 18：00</td>
                                    <td align="right">
                                        <a href="">同意</a>
                                        (100)
                                    </td>
                                </tr>
                            </table>

                        </div>

                        <div class="node">
                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td rowspan="3" width="80" align="right" valign="top">
                                        <img src="{$r}/img/i-f-weibo.jpg" alt=""></td>
                                    <td colspan="2">用户名</td>
                                </tr>
                                <tr>
                                    <td colspan="2">评论内容</td>
                                </tr>
                                <tr>
                                    <td>2016-01-01 18：00</td>
                                    <td align="right">
                                        <a href="">同意</a>
                                        (100)
                                    </td>
                                </tr>
                            </table>

                        </div>

                    </div>
                    <div class="pager">
                        <a class="index" href="">首页</a>
                        <a class="pre" href="">上一页</a>
                        <a href="">1</a>
                        <a href="">2</a>
                        <a class="next" href="">下一页</a>
                        <a class="end" href="">末页</a>
                    </div>
                </div>




                <div class="wenti" style="display:none;">
                    <div class="inner">
                        <center>常见问题</center>
                        <h1>购买运费如何收取？</h1>
                        <p>本商城所有物品包邮（港澳台地区以及国外除外）。</p>

                        <h1>使用什么快递发货？</h1>
                        <p>使用快递发货（个别商品使用其他快递），配送范围覆盖全国大部分地区（港澳台地区除外）。</p>

                        <h1>如何申请退货？</h1>
                        <p>1.自收到商品之日起7日内，顾客可申请无忧退货，退款将原路返还，不同的银行处理时间不同，预计1-5个工作日到账；</p>
                        <p>2.退货流程：确认收货-申请退货-客服审核通过-客户商品寄回-仓库签收入库-退款完成</p>
                        <p>3.因金贵银器产生的退货，如质量问题，退货邮费由金贵银器承担，退款完成后会以现金券的形式报销；因客户个人原因产生的退货，购买和寄回运费由客户个人承担。</p>

                        <h1>如何开具发票？</h1>
                        <p>1.如需开具发票，可在购买商品1个月内（以支付时间计算）联系客服，为该商品索取发票；</p>
                    </div>

                </div>
            </div>
            <?php if ($output['goods']['is_virtual'] == 1) {?>
                <!-- S 商城地址地图 -->
                <div class="ncs-shop-map">
                    <div class="ncs-goods-title-bar hd">
                        <h4><a href="javascript:void(0);">商家位置</a></h4>
                    </div>
                    <div class="bd" id="ncStoreMap" style="border: solid #E6E6E6; border-width: 0 1px 1px; margin-bottom: 20px; display:none; overflow: hidden;"> </div>
                </div>
                <!-- E 商城地址地图 -->
            <?php }?>
            <!-- shopwwi-->
            <!--youce-->

        </div>

        <div class="main-right right-side">
            <div class="title">活动推荐</div>
            <div class="item">1</div>
            <div class="item">2</div>
            <div class="item">3</div>
        </div>

    </div>
</div>
<form id="buynow_form" method="post" action="<?php echo SHOP_SITE_URL;?>/index.php">
    <input id="act" name="act" type="hidden" value="buy" />
    <input id="op" name="op" type="hidden" value="buy_step1" />
    <input id="cart_id" name="cart_id[]" type="hidden"/>
</form>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.charCount.js"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.ajaxContent.pack.js" type="text/javascript"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/sns.js" type="text/javascript" charset="utf-8"></script>
<script src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.F_slider.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/waypoints.js"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.raty/jquery.raty.min.js"></script>
<script type="text/javascript" src="<?php echo RESOURCE_SITE_URL;?>/js/jquery.nyroModal/custom.min.js" charset="utf-8"></script>
<link href="<?php echo RESOURCE_SITE_URL;?>/js/jquery.nyroModal/styles/nyroModal.css" rel="stylesheet" type="text/css" id="cssfile2" />
<script type="text/javascript">
    /** 辅助浏览 **/

        //产品图片
    jQuery(function($){
        // 放大镜效果 产品图片
        CloudZoom.quickStart();

        // 图片切换效果
        $(".controller li").first().addClass('current');
        $('.controller').find('li').mouseover(function(){
            $(this).first().addClass("current").siblings().removeClass("current");
        });
    });

    //收藏分享处下拉操作
    jQuery.divselect = function(divselectid,inputselectid) {
        var inputselect = $(inputselectid);
        $(divselectid).mouseover(function(){
            var ul = $(divselectid+" ul");
            ul.slideDown("fast");
            if(ul.css("display")=="none"){
                ul.slideDown("fast");
            }
        });
        $(divselectid).live('mouseleave',function(){
            $(divselectid+" ul").hide();
        });
    };
    $(function(){
        //赠品处滚条

        <?php if ($output['goods']['goods_state'] == 1 && $output['goods']['goods_storage'] > 0 ) {?>
        // 加入购物车
        $('a[nctype="addcart_submit"]').click(function(){
            if (typeof(allow_buy) != 'undefined' && allow_buy === false) return ;
            addcart(<?php echo $output['goods']['goods_id'];?>, checkQuantity(),'addcart_callback');
        });
        <?php if (!($output['goods']['is_virtual'] == 1 && $output['goods']['virtual_indate'] < TIMESTAMP)) {?>
        // 立即购买
        $('a[nctype="buynow_submit"]').click(function(){
            if (typeof(allow_buy) != 'undefined' && allow_buy === false) return ;
            buynow(<?php echo $output['goods']['goods_id']?>,checkQuantity());
        });
        <?php }?>
        <?php }?>
        // 到货通知
        <?php if ($output['goods']['goods_storage'] == 0 || $output['goods']['goods_state'] == 0) {?>
        $('a[nctype="arrival_notice"]').click(function(){
            <?php if ($_SESSION['is_login'] !== '1'){?>
            login_dialog();
            <?php }else{?>
            ajax_form('arrival_notice', '到货通知','<?php echo urlShop('goods', 'arrival_notice', array('goods_id' => $output['goods']['goods_id']));?>', 350);
            <?php }?>
        });
        <?php }?>
        //浮动导航  waypoints.js
        /*
         $('#main-nav').waypoint(function(event, direction) {
         $(this).parent().parent().parent().toggleClass('sticky', direction === "down");
         event.stopPropagation();
         });
         */
        // 分享收藏下拉操作
        $.divselect("#handle-l");
        $.divselect("#handle-r");

        // 规格选择
        $('dl[nctype="nc-spec"]').find('a').each(function(){
            $(this).click(function(){
                if ($(this).hasClass('hovered')) {
                    return false;
                }
                $(this).parents('ul:first').find('a').removeClass('hovered');
                $(this).addClass('hovered');
                checkSpec();
            });
        });

    });

    function checkSpec() {
        var spec_param = <?php echo $output['spec_list'];?>;
        var spec = new Array();
        $('ul[nctyle="ul_sign"]').find('.hovered').each(function(){
            var data_str = ''; eval('data_str =' + $(this).attr('data-param'));
            spec.push(data_str.valid);
        });
        spec1 = spec.sort(function(a,b){
            return a-b;
        });
        var spec_sign = spec1.join('|');
        $.each(spec_param, function(i, n){
            if (n.sign == spec_sign) {
                window.location.href = n.url;
            }
        });
    }

    // 验证购买数量
    function checkQuantity(){
        var quantity = parseInt($("#quantity").val());
        if (quantity < 1) {
            alert("<?php echo $lang['goods_index_pleaseaddnum'];?>");
            $("#quantity").val('1');
            return false;
        }
        max = parseInt($('[nctype="goods_stock"]').text());
        <?php if ($output['goods']['is_virtual'] == 1 && $output['goods']['virtual_limit'] > 0) {?>
        max = <?php echo $output['goods']['virtual_limit'];?>;
        if(quantity > max){
            alert('最多限购'+max+'件');
            return false;
        }
        <?php } ?>
        <?php if (!empty($output['goods']['upper_limit'])) {?>
        max = <?php echo $output['goods']['upper_limit'];?>;
        if(quantity > max){
            alert('最多限购'+max+'件');
            return false;
        }
        <?php } ?>
        if(quantity > max){
            alert("<?php echo $lang['goods_index_add_too_much'];?>");
            return false;
        }
        return quantity;
    }

    // 立即购买js
    function buynow(goods_id,quantity,chain_id,area_id,area_name,area_id_2){
        <?php if ($_SESSION['is_login'] !== '1'){?>
        login_dialog();
        <?php }else{?>
        if (!quantity) {
            return;
        }
        <?php if ($_SESSION['store_id'] == $output['goods']['store_id']) { ?>
        alert('不能购买自己商城的商品');return;
        <?php } ?>
        $("#cart_id").val(goods_id+'|'+quantity);
        if (typeof chain_id == 'number') {
            $('#buynow_form').append('<input type="hidden" name="ifchain" value="1"><input type="hidden" name="chain_id" value="'+chain_id+'"><input type="hidden" name="area_id" value="'+area_id+'"><input type="hidden" name="area_name" value="'+area_name+'"><input type="hidden" name="area_id_2" value="'+area_id_2+'">');
        }
        $("#buynow_form").submit();
        <?php }?>
    }

    $(function(){
        //选择地区查看运费
        $('#transport_pannel>a').click(function(){
            var id = $(this).attr('nctype');
            if (id=='undefined') return false;
            var _self = this,tpl_id = '<?php echo $output['goods']['transport_id'];?>';
            var url = 'index.php?act=goods&op=calc&rand='+Math.random();
            $('#transport_price').css('display','none');
            $('#loading_price').css('display','');
            $.getJSON(url, {'id':id,'tid':tpl_id}, function(data){
                if (data == null) return false;
                if(data != 'undefined') {$('#nc_kd').html('运费<?php echo $lang['nc_colon'];?><em>' + data + '</em><?php echo $lang['goods_index_yuan'];?>');}else{'<?php echo $lang['goods_index_trans_for_seller'];?>';}
                $('#transport_price').css('display','');
                $('#loading_price').css('display','none');
                $('#ncrecive').html($(_self).html());
            });
        });
        $("#nc-bundling").load('index.php?act=goods&op=get_bundling&goods_id=<?php echo $output['goods']['goods_id'];?>', function(){
            if($(this).html() != '') {
                $(this).show();
            }
        });
        <?php if ($output['goods']['is_virtual'] == 1) {?>
        $("#ncStoreMap").load('index.php?act=show_map&op=index&w=420&h=400&store_id=<?php echo $output['goods']['store_id'];?>', function(){
            if($(this).html() != '') {
                $(this).show();
            }
        });
        <?php } ?>
        $("#salelog_demo").load('index.php?act=goods&op=salelog&goods_id=<?php echo $output['goods']['goods_id'];?>&store_id=<?php echo $output['goods']['store_id'];?>&vr=<?php echo $output['goods']['is_virtual'];?>', function(){
            // Membership card
            $(this).find('[nctype="mcard"]').membershipCard({type:'shop'});
        });
        $("#consulting_demo").load('index.php?act=goods&op=consulting&goods_id=<?php echo $output['goods']['goods_id'];?>&store_id=<?php echo $output['goods']['store_id'];?>', function(){
            // Membership card
            $(this).find('[nctype="mcard"]').membershipCard({type:'shop'});
        });

        /** goods.php **/
            // 商品内容部分折叠收起侧边栏控制
        $('#fold').click(function(){
            $('.ncs-goods-layout').toggleClass('expanded');
        });

        $("#i_checkbox .checkbox").click(function(){
            $(this).addClass("hover").siblings().removeClass("hover")
            $("#i_checkbox input[type=hidden]").val($(this).children("span").data("value"))

        })



        // 商品内容介绍Tab样式切换控制
        $('#categorymenu').find("li").click(function(){
            $('#categorymenu').find("li").removeClass('current');
            $(this).addClass('current');
            $(".ncs-intro>div").eq($(this).index()).show().siblings().hide()
        });
        // 商品详情默认情况下显示全部
        $('#tabGoodsIntro').click(function(){
            $('.bd').css('display','');
            $('.hd').css('display','');
            $('.report_img').css('display','none');
        });

        $('#tabReportImage').click(function(){
            $('.bd').css('display','none');
            $('.hd').css('display','none');
            $('.report_img').css('display','');
        });

        // 点击地图隐藏其他以及其标题栏
        $('#tabStoreMap').click(function(){
            $('.bd').css('display','none');
            $('#ncStoreMap').css('display','');
            $('.hd').css('display','none');
            $('.report_img').css('display','none');
        });
        // 点击评价隐藏其他以及其标题栏
        $('#tabGoodsRate').click(function(){
            $('.bd').css('display','none');
            $('#ncGoodsRate').css('display','');
            $('.hd').css('display','none');
            $('.report_img').css('display','none');
        });
        // 点击成交隐藏其他以及其标题
        $('#tabGoodsTraded').click(function(){
            $('.bd').css('display','none');
            $('#ncGoodsTraded').css('display','');
            $('.hd').css('display','none');
            $('.report_img').css('display','none');
        });
        // 点击咨询隐藏其他以及其标题
        $('#tabGuestbook').click(function(){
            $('.bd').css('display','none');
            $('#ncGuestbook').css('display','');
            $('.hd').css('display','none');
            $('.report_img').css('display','none');
        });
        //商品排行Tab切换
        $(".ncs-top-tab > li > a").mouseover(function(e) {
            if (e.target == this) {
                var tabs = $(this).parent().parent().children("li");
                var panels = $(this).parent().parent().parent().children(".ncs-top-panel");
                var index = $.inArray(this, $(this).parent().parent().find("a"));
                if (panels.eq(index)[0]) {
                    tabs.removeClass("current ").eq(index).addClass("current ");
                    panels.addClass("hide").eq(index).removeClass("hide");
                }
            }
        });
        //信用评价动态评分打分人次Tab切换
        $(".ncs-rate-tab > li > a").mouseover(function(e) {
            if (e.target == this) {
                var tabs = $(this).parent().parent().children("li");
                var panels = $(this).parent().parent().parent().children(".ncs-rate-panel");
                var index = $.inArray(this, $(this).parent().parent().find("a"));
                if (panels.eq(index)[0]) {
                    tabs.removeClass("current ").eq(index).addClass("current ");
                    panels.addClass("hide").eq(index).removeClass("hide");
                }
            }
        });

//触及显示缩略图
        $('.goods-pic > .thumb').hover(
            function(){
                $(this).next().css('display','block');
            },
            function(){
                $(this).next().css('display','none');
            }
        );

        /* 商品购买数量增减js */
        // 增加
        $('a[nctype="increase"]').click(function(){
            num = parseInt($('#quantity').val());
            <?php if ($output['goods']['is_virtual'] == 1 && $output['goods']['virtual_limit'] > 0) {?>
            max = <?php echo $output['goods']['virtual_limit'];?>;
            if(num >= max){
                alert('最多限购'+max+'件');
                return false;
            }
            <?php } ?>
            <?php if (!empty($output['goods']['upper_limit'])) {?>
            max = <?php echo $output['goods']['upper_limit'];?>;
            if(num >= max){
                alert('最多限购'+max+'件');
                return false;
            }
            <?php } ?>
            max = parseInt($('[nctype="goods_stock"]').text());
            if(num < max){
                $('#quantity').val(num+1);
            }
        });
        //减少
        $('a[nctype="decrease"]').click(function(){
            num = parseInt($('#quantity').val());
            if(num > 1){
                $('#quantity').val(num-1);
            }
        });

        //评价列表
        $('#comment_tab').on('click', 'li', function() {
            $('#comment_tab li').removeClass('current');
            $(this).addClass('current');
            load_goodseval($(this).attr('data-type'));
        });
        load_goodseval('all');
        function load_goodseval(type) {
            var url = '<?php echo urlShop('goods', 'comments', array('goods_id' => $output['goods']['goods_id']));?>';
            url += '&type=' + type;
            $("#goodseval").load(url, function(){
                $(this).find('[nctype="mcard"]').membershipCard({type:'shop'});
            });
        }

        //记录浏览历史
        $.get("index.php?act=goods&op=addbrowse",{gid:<?php echo $output['goods']['goods_id'];?>});
        //初始化对比按钮


        $('[nctype="show_chain"]').click(function(){
            _goods_id = $(this).attr('data-goodsid');
            ajax_form('show_chain', '查看门店', 'index.php?act=goods&op=show_chain&goods_id=' + _goods_id, 640);
        });

        <?php if ($output['goods']['jjg_explain']) { ?>
        $('.couRuleScrollbar').perfectScrollbar({suppressScrollX:true});
        <?php }?>

        // 满即送、加价购显示隐藏
        $('[nctype="show-rule"]').click(function(){
            $(this).parent().find('[nctype="rule-content"]').show();
        });
        $('[nctype="hide-rule"]').click(function(){
            $(this).parents('[nctype="rule-content"]:first').hide()
        });

        $('.ncs-buy').bind({
            mouseover:function(){$(".ncs-point").show();},
            mouseout:function(){$(".ncs-point").hide();}
        });

    });

    /* 加入购物车后的效果函数 */
    function addcart_callback(data){
        $('#bold_num').html(data.num);
        $('#bold_mly').html(price_format(data.amount));
        $('.ncs-cart-popup').fadeIn('fast');
    }

    <?php if($output['goods']['goods_state'] == 1 && $output['goods']['goods_verify'] == 1 && $output['goods']['is_virtual'] == 0){ ?>
    var $cur_area_list,$cur_tab,next_tab_id = 0,cur_select_area = [],calc_area_id = '',calced_area = [],cur_select_area_ids = [];
    $(document).ready(function(){
        $("#ncs-freight-selector").hover(function() {
            //如果商城没有设置默认显示区域，马上异步请求
            <?php if (!$output['store_info']['deliver_region']) { ?>
            if (typeof nc_a === "undefined") {
                $.getJSON(SITEURL + "/index.php?act=index&op=json_area&callback=?", function(data) {
                    nc_a = data;
                    $cur_tab = $('#ncs-stock').find('li[data-index="0"]');
                    _loadArea(0);
                });
            }
            <?php } ?>
            $(this).addClass("hover");
            $(this).on('mouseleave',function(){
                $(this).removeClass("hover");
            });
        });

        $('ul[class="area-list"]').on('click','a',function(){
            $('#ncs-freight-selector').unbind('mouseleave');
            var tab_id = parseInt($(this).parents('div[data-widget="tab-content"]:first').attr('data-area'));
            if (tab_id == 0) {cur_select_area = [];cur_select_area_ids = []};
            if (tab_id == 1 && cur_select_area.length > 1) {
                cur_select_area.pop();
                cur_select_area_ids.pop();
                if (cur_select_area.length > 1) {
                    cur_select_area.pop();
                    cur_select_area_ids.pop();
                }
            }
            next_tab_id = tab_id + 1;
            var area_id = $(this).attr('data-value');
            $cur_tab = $('#ncs-stock').find('li[data-index="'+tab_id+'"]');
            $cur_tab.find('em').html($(this).html());
            $cur_tab.find('i').html(' ∨');
            if (tab_id < 2) {
                calc_area_id = area_id;
                cur_select_area.push($(this).html());
                cur_select_area_ids.push(area_id);
                $cur_tab.find('a').removeClass('hover');
                $cur_tab.nextAll().remove();
                if (typeof nc_a === "undefined") {
                    $.getJSON(SITEURL + "/index.php?act=index&op=json_area&callback=?", function(data) {
                        nc_a = data;
                        _loadArea(area_id);
                    });
                } else {
                    _loadArea(area_id);
                }
            } else {
                //点击第三级，不需要显示子分类
                if (cur_select_area.length == 3) {
                    cur_select_area.pop();
                    cur_select_area_ids.pop();
                }
                cur_select_area.push($(this).html());
                cur_select_area_ids.push(area_id);
                $('#ncs-freight-selector > div[class="text"] > div').html(cur_select_area.join(''));
                $('#ncs-freight-selector').removeClass("hover");
                _calc();
            }
            $('#ncs-stock').find('li[data-widget="tab-item"]').on('click','a',function(){
                var tab_id = parseInt($(this).parent().attr('data-index'));
                if (tab_id < 2) {
                    $(this).parent().nextAll().remove();
                    $(this).addClass('hover');
                    $('#ncs-stock').find('div[data-widget="tab-content"]').each(function(){
                        if ($(this).attr("data-area") == tab_id) {
                            $(this).show();
                        } else {
                            $(this).hide();
                        }
                    });
                }
            });
        });
        function _loadArea(area_id){
            if (nc_a[area_id] && nc_a[area_id].length > 0) {
                $('#ncs-stock').find('div[data-widget="tab-content"]').each(function(){
                    if ($(this).attr("data-area") == next_tab_id) {
                        $(this).show();
                        $cur_area_list = $(this).find('ul');
                        $cur_area_list.html('');
                    } else {
                        $(this).hide();
                    }
                });
                var areas = [];
                areas = nc_a[area_id];
                for (i = 0; i < areas.length; i++) {
                    if (areas[i][1].length > 8) {
                        $cur_area_list.append("<li class='longer-area'><a data-value='" + areas[i][0] + "' href='#none'>" + areas[i][1] + "</a></li>");
                    } else {
                        $cur_area_list.append("<li><a data-value='" + areas[i][0] + "' href='#none'>" + areas[i][1] + "</a></li>");
                    }
                }
                if (area_id > 0){
                    $cur_tab.after('<li data-index="' + (next_tab_id) + '" data-widget="tab-item"><a class="hover" href="#none" ><em>请选择</em><i> ∨</i></a></li>');
                }
            } else {
                //点击第一二级时，已经到了最后一级
                $cur_tab.find('a').addClass('hover');
                $('#ncs-freight-selector > div[class="text"] > div').html(cur_select_area);
                $('#ncs-freight-selector').removeClass("hover");
                _calc();
            }
        }
        //计算运费，是否配送
        function _calc() {
            $.cookie('dregion', cur_select_area_ids.join(' ')+'|'+cur_select_area.join(' '), { expires: 30 });
            <?php if (! $output['goods']['transport_id']) { ?>
            return;
            <?php } ?>
            var _args = '';
            _args += "&tid=<?php echo $output['goods']['transport_id']?>";
            <?php if ($output['store_info']['is_own_shop']) { ?>
            _args += "&super=1";
            <?php } ?>
            if (_args != '') {
                _args += '&area_id=' + calc_area_id ;
                if (typeof calced_area[calc_area_id] == 'undefined') {
                    //需要请求配送区域设置
                    $.getJSON(SITEURL + "/index.php?act=goods&op=calc&" + _args + "&myf=<?php echo $output['store_info']['store_free_price']?>&callback=?", function(data){
                        allow_buy = data.total ? true : false;
                        calced_area[calc_area_id] = data.total;
                        if (data.total === false) {
                            $('#ncs-freight-prompt > strong').html('无货').next().remove();
                            $('a[nctype="buynow_submit"]').addClass('no-buynow');
                            $('a[nctype="addcart_submit"]').addClass('no-buynow');
                        } else {
                            $('#ncs-freight-prompt > strong').html('有货 ').next().remove();
                            $('#ncs-freight-prompt > strong').after('<span>' + data.total + '</span>');
                            $('a[nctype="buynow_submit"]').removeClass('no-buynow');
                            $('a[nctype="addcart_submit"]').removeClass('no-buynow');
                        }
                    });
                } else {
                    if (calced_area[calc_area_id] === false) {
                        $('#ncs-freight-prompt > strong').html('无货').next().remove();
                        $('a[nctype="buynow_submit"]').addClass('no-buynow');
                        $('a[nctype="addcart_submit"]').addClass('no-buynow');
                    } else {
                        $('#ncs-freight-prompt > strong').html('有货 ').next().remove();
                        $('#ncs-freight-prompt > strong').after('<span>' + calced_area[calc_area_id] + '</span>');
                        $('a[nctype="buynow_submit"]').removeClass('no-buynow');
                        $('a[nctype="addcart_submit"]').removeClass('no-buynow');
                    }
                }
            }
        }
        //如果商城设置默认显示配送区域
        <?php if ($output['store_info']['deliver_region']) { ?>
        if (typeof nc_a === "undefined") {
            $.getJSON(SITEURL + "/index.php?act=index&op=json_area&callback=?", function(data) {
                nc_a = data;
                $cur_tab = $('#ncs-stock').find('li[data-index="0"]');
                _loadArea(0);
                $('ul[class="area-list"]').find('a[data-value="<?php echo $output['store_info']['deliver_region_ids'][0]?>"]').click();
                <?php if ($output['store_info']['deliver_region_ids'][1]) { ?>
                $('ul[class="area-list"]').find('a[data-value="<?php echo $output['store_info']['deliver_region_ids'][1]?>"]').click();
                <?php } ?>
                <?php if ($output['store_info']['deliver_region_ids'][2]) { ?>
                $('ul[class="area-list"]').find('a[data-value="<?php echo $output['store_info']['deliver_region_ids'][2]?>"]').click();
                <?php } ?>
            });
        }
        <?php } ?>
    });
    <?php }?>
</script>

